<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    duede
    var xhr = new XMLHttpRequest();
    xhr.onreadystatechange = function () {
        if (xhr.readyState == 4) {
            if (xhr.status = 200) {
                alert(xhr.responseText)
            }
        }
    }
    xhr.open('GET', '')
    xhr.send(null)

    new Promise((resolve, reject) => {
        setTimeout(() => {
            resolve(2)
        })
    }).then(value => {
        console.log('value', value)
    }), reason => {
        console.log('reason', reason)
    }
</script>
</body>
</html>